package com.glq1218.controller;

import com.glq1218.domain.vo.ArticleListVo;
import com.glq1218.domain.vo.ArticleVo;
import com.glq1218.domain.vo.PageVo;
import com.glq1218.response.ResponseResult;
import com.glq1218.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/article")
public class ArticleController {
    @Autowired
    private ArticleService articleService;

    @GetMapping("/listArticles")
    public ResponseResult<PageVo<ArticleListVo>> listArticles(Integer pageNum, Integer pageSize) {
        return articleService.listArticles(pageNum, pageSize);
    }

    // @GetMapping("/article/{id}")
    // public ResponseResult<ArticleVo> getArticleById(@PathVariable("id") Long id){
    //
    // }
}
